<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../Templates/SaleLeadTemplate.xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="content">
        <h:form>
        <p:dataTable var="saleLead" value="#{saleLeadDataTableBean.saleLeads}" 
dynamic="true" paginator="true" rows="5" emptyMessage="No sale lead"> 
                    <p:column sortBy="#{saleLead.saleLeadId}"> 
                        <f:facet name="header"> 
                            <h:outputText value="ID" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.saleLeadId}" /> 
                    </p:column> 
 
                    <p:column sortBy="#{saleLead.saleLeadName}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Name" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.saleLeadName}" /> 
                    </p:column> 
                   
                    <p:column sortBy="#{saleLead.saleLeadNRIC}"> 
                        <f:facet name="header"> 
                            <h:outputText value="NRIC" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.saleLeadNRIC}" /> 
                    </p:column>
            
                    <p:column sortBy="#{saleLead.saleLeadEmail}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Email" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.saleLeadEmail}" /> 
                    </p:column>
            
                    <p:column sortBy="#{saleLead.saleLeadAddress}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Address" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.saleLeadAddress}" /> 
                    </p:column>
            
                    <p:column sortBy="#{saleLead.saleLeadContactNumber}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Contact Number" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.saleLeadContactNumber}" /> 
                    </p:column>
            
                    <p:column sortBy="#{saleLead.customerType}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Customer Type" /> 
                        </f:facet> 
                        <h:outputText value="#{saleLead.customerType}" /> 
                    </p:column>
            
                    <p:column>
                        <p:commandButton value="Edit" actionListener="#{saleLeadDataTableBean.editSaleLead}">     
                            <f:attribute name="selectedSaleLead" value="#{saleLead}" />                            
                        </p:commandButton>    
                        
                        <p:commandButton value ="Delete" actionListener="#{saleLeadDataTableBean.deleteSaleLead}">
                            <f:attribute name="selectedSaleLead" value ="#{saleLead}"/>
                        </p:commandButton>
                    </p:column>
        </p:dataTable>
        </h:form>
    </ui:define>

</ui:composition>
